#pragma once

#pragma unmanaged

#include <BWSAL\UnitGroupManager.h>

#pragma managed

#include "..\AiBase.h"
#include "UnitGroup.h"
#include "Interfaces\IUnitGroupManager.h"

using namespace BroodWar::Api;

namespace BroodWar
{
	namespace Addon
	{
		public ref class UnitGroupManager : public AiBase, IUnitGroupManager
		{
		internal:
			BWSAL::UnitGroupManager* instance;

			UnitGroupManager();
			~UnitGroupManager();
			!UnitGroupManager();

			static UnitGroupManager^ s_instance;
		public:
			static property UnitGroupManager^ Instance { UnitGroupManager^ get(); }

			virtual void OnUnitDiscover(Unit^ unit) override;
			virtual void OnUnitEvade(Unit^ unit) override;
			virtual void OnUnitMorph(Unit^ unit) override;
			virtual void OnUnitRenegade(Unit^ unit) override;

			static property UnitGroup^ AllUnits { UnitGroup^ get(); }
			static UnitGroup^ SelectAll();
			static UnitGroup^ SelectAll(Api::Enum::UnitType type);
			static UnitGroup^ SelectAllEnemy();
			static UnitGroup^ SelectAllEnemy(Api::Enum::UnitType type);
			static UnitGroup^ SelectAll(Player^ player, Api::Enum::UnitType type);
		};
	}
}
